﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetCs.Model;
using AspNetCs.Bll;
using System.Data;
using System.Collections;
using AspNetCs.Enumerations;
using AspNetCs.Enumerations.memorial_enum;
using AspNetCs.Enumerations.User_Enum;
using AspNetCs.Common;
using AspNetCs.Enumerations.Channel_Enum;

public partial class Users_AddAncestralHallItems :BasePage
{
    protected int AncestralHallId = 0;
    private AncestralHallItemsBLL bll = new AncestralHallItemsBLL();
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckUserExit("Login.Aspx", "请您登录", true);

        if (!IsPostBack)
        {
            if (string.IsNullOrEmpty(Request["id"]))
            {
                ResultStr("Login.aspx", "参数错误");
            }
            else
            {
                ViewState["Id"] = Request["id"];
                this.AncestralHallId = StringHelper.isNumber_int(Request["id"]);
            }
        }
        else
        {
            if (ViewState["Id"] != null)
            {
                this.AncestralHallId = StringHelper.isNumber_int(ViewState["Id"].ToString());
            }
        }
    }

    protected void btnCreate_Click(object sender, EventArgs e)
    {
        AncestralHallItems_Model model = new AncestralHallItems_Model();
        model.AncestralHallId = this.AncestralHallId;
        model.CreateTime = DateTime.Now;
        model.Introduction = WebEditor1.Text;
        model.IsCheck = 0;
        model.IsDel = 0;
        model.IsSys = 0;
        model.ItemLogo = Txt_UpImg.Text;
        model.ItemName = txtItemName.Text;

        bll.Add(model);

        ResultStr("AddAncestralHallItems_" + this.AncestralHallId + ".aspx", "添加成功!");
    }
}
